public class WebTestContextBootstrapper extends DefaultTestContextBootstrapper
TestContextBootstrapper
SPI.
ServletTestExecutionListener
to the list of default TestExecutionListeners
supported by
the superclass.
WebDelegatingSmartContextLoader
as the default ContextLoader
if the test class is annotated with @WebAppConfiguration
and otherwise delegates to the superclass.
WebMergedContextConfiguration
if the test class is annotated
with @WebAppConfiguration
and otherwise delegates to
the superclass.
Constructor and Description |
---|
WebTestContextBootstrapper() |
Modifier and Type | Method and Description |
---|---|
protected MergedContextConfiguration |
buildMergedContextConfiguration(java.lang.Class<?> testClass,
java.lang.String[] locations,
java.lang.Class<?>[] classes,
java.util.Set<java.lang.Class<? extends ApplicationContextInitializer<? extends ConfigurableApplicationContext>>> initializerClasses,
java.lang.String[] activeProfiles,
ContextLoader contextLoader,
CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate,
MergedContextConfiguration parentConfig)
Builds a
WebMergedContextConfiguration if the supplied class is
annotated with @WebAppConfiguration and
otherwise delegates to the superclass. |
protected java.lang.Class<? extends ContextLoader> |
getDefaultContextLoaderClass(java.lang.Class<?> testClass)
Returns
WebDelegatingSmartContextLoader if the supplied class is
annotated with @WebAppConfiguration and
otherwise delegates to the superclass. |
protected java.util.List<java.lang.String> |
getDefaultTestExecutionListenerClassNames()
Prepends
ServletTestExecutionListener
to the list of default TestExecutionListeners
supported by the superclass and returns an unmodifiable, updated list. |
buildMergedContextConfiguration, getBootstrapContext, getDefaultTestExecutionListenerClasses, getTestExecutionListeners, setBootstrapContext
protected java.util.List<java.lang.String> getDefaultTestExecutionListenerClassNames()
ServletTestExecutionListener
to the list of default TestExecutionListeners
supported by the superclass and returns an unmodifiable, updated list.getDefaultTestExecutionListenerClassNames
in class DefaultTestContextBootstrapper
TestExecutionListener
classesprotected java.lang.Class<? extends ContextLoader> getDefaultContextLoaderClass(java.lang.Class<?> testClass)
WebDelegatingSmartContextLoader
if the supplied class is
annotated with @WebAppConfiguration
and
otherwise delegates to the superclass.getDefaultContextLoaderClass
in class DefaultTestContextBootstrapper
testClass
- the test class for which to retrieve the default
ContextLoader
classprotected MergedContextConfiguration buildMergedContextConfiguration(java.lang.Class<?> testClass, java.lang.String[] locations, java.lang.Class<?>[] classes, java.util.Set<java.lang.Class<? extends ApplicationContextInitializer<? extends ConfigurableApplicationContext>>> initializerClasses, java.lang.String[] activeProfiles, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parentConfig)
WebMergedContextConfiguration
if the supplied class is
annotated with @WebAppConfiguration
and
otherwise delegates to the superclass.buildMergedContextConfiguration
in class DefaultTestContextBootstrapper
testClass
- the test class for which the MergedContextConfiguration
should be built (must not be null
)locations
- the merged resource locationsclasses
- the merged annotated classesinitializerClasses
- the merged context initializer classesactiveProfiles
- the merged active bean definition profilescontextLoader
- the resolved ContextLoader
cacheAwareContextLoaderDelegate
- the cache-aware context loader delegate
to be provided to the instantiated MergedContextConfiguration
parentConfig
- the merged context configuration for the parent application
context in a context hierarchy, or null
if there is no parentMergedContextConfiguration